# VERBOSE = True
VERBOSE = False

frame_length = 512
init_alpha = -500
sample_rate = 16000


is_pure_time_domain = True

if is_pure_time_domain:
    max_amp_tr = 33.461480140686035  # pure time domain
else:
    max_amp_tr = 22.307652973859113  # lpc time domain

overlap_each_side = 32
training_data_size = 500000
selected_ind = [8.0, 16.0, 32.0, 128.0]


# scalar_or_vector = 'scalar-2'
scalar_or_vector = 'scalar-4'
# scalar_or_vector = 'vector-2'
# scalar_or_vector = 'vector-4'

def data_frame_setup():
    if scalar_or_vector == 'scalar-2':
        _code_len_val = 256   # bottle_neck_size/code_len_val will be the code unit len.
        _code_book_size_val = 32  # the num of the code in the codebook.
        # the size of the codebook is code_book_size_val * (bottle_neck_size/code_len_val)
        _bottle_neck_size = 256
    elif scalar_or_vector == 'scalar-4':
        _code_len_val = 128
        _code_book_size_val = 32
        _bottle_neck_size = 128
    elif scalar_or_vector == 'vector-2':
        _code_len_val = 128
        _code_book_size_val = 1024
        _bottle_neck_size = 256
    elif scalar_or_vector == 'vector-4':
        _code_len_val = 64
        _code_book_size_val = 1024
        _bottle_neck_size = 128
    else:
        print('WRONG INPUT...')
    return _code_len_val, _code_book_size_val, _bottle_neck_size

code_len_val, code_book_size_val, bottle_neck_size = data_frame_setup()



# max_amp_tr = 22.307652973859113 # lpc time domain
lpc_perceptual_weighting_coeff = 0.92
empha_filter_coeff = -0.68

lpc_coeff_lsf_bins_256_signal_preprosessed_final_flat = [0.02936247, 0.0663777 , 0.10339293, 0.14040815, 0.17742338,
       0.21443861, 0.25145384, 0.28846906, 0.32548429, 0.36249952,
       0.39951474, 0.43652997, 0.4735452 , 0.51056042, 0.54757565,
       0.58459088, 0.0912829 , 0.14135953, 0.19143615, 0.24151278,
       0.29158941, 0.34166604, 0.39174267, 0.44181929, 0.49189592,
       0.54197255, 0.59204918, 0.64212581, 0.69220244, 0.74227906,
       0.79235569, 0.84243232, 0.2238604 , 0.28238721, 0.34091401,
       0.39944082, 0.45796762, 0.51649443, 0.57502123, 0.63354803,
       0.69207484, 0.75060164, 0.80912845, 0.86765525, 0.92618205,
       0.98470886, 1.04323566, 1.10176247, 0.2591707 , 0.32686132,
       0.39455193, 0.46224255, 0.52993317, 0.59762379, 0.66531441,
       0.73300502, 0.80069564, 0.86838626, 0.93607688, 1.0037675 ,
       1.07145811, 1.13914873, 1.20683935, 1.27452997, 0.4004849 ,
       0.46910377, 0.53772264, 0.60634152, 0.67496039, 0.74357926,
       0.81219813, 0.880817  , 0.94943588, 1.01805475, 1.08667362,
       1.15529249, 1.22391137, 1.29253024, 1.36114911, 1.42976798,
       0.54279441, 0.613812  , 0.6848296 , 0.75584719, 0.82686478,
       0.89788237, 0.96889996, 1.03991756, 1.11093515, 1.18195274,
       1.25297033, 1.32398793, 1.39500552, 1.46602311, 1.5370407 ,
       1.60805829, 0.70937284, 0.78014384, 0.85091485, 0.92168585,
       0.99245685, 1.06322785, 1.13399886, 1.20476986, 1.27554086,
       1.34631186, 1.41708287, 1.48785387, 1.55862487, 1.62939587,
       1.70016687, 1.77093788, 0.96588457, 1.02802064, 1.09015672,
       1.15229279, 1.21442886, 1.27656494, 1.33870101, 1.40083709,
       1.46297316, 1.52510924, 1.58724531, 1.64938138, 1.71151746,
       1.77365353, 1.83578961, 1.89792568, 1.13722686, 1.20044319,
       1.26365952, 1.32687585, 1.39009219, 1.45330852, 1.51652485,
       1.57974118, 1.64295752, 1.70617385, 1.76939018, 1.83260651,
       1.89582284, 1.95903918, 2.02225551, 2.08547184, 1.28006604,
       1.34688482, 1.4137036 , 1.48052237, 1.54734115, 1.61415993,
       1.6809787 , 1.74779748, 1.81461626, 1.88143503, 1.94825381,
       2.01507259, 2.08189136, 2.14871014, 2.21552892, 2.28234769,
       1.46049207, 1.5283549 , 1.59621773, 1.66408056, 1.73194339,
       1.79980621, 1.86766904, 1.93553187, 2.0033947 , 2.07125753,
       2.13912036, 2.20698319, 2.27484601, 2.34270884, 2.41057167,
       2.4784345 , 1.62748408, 1.68920132, 1.75091855, 1.81263579,
       1.87435303, 1.93607027, 1.99778751, 2.05950475, 2.12122198,
       2.18293922, 2.24465646, 2.3063737 , 2.36809094, 2.42980818,
       2.49152541, 2.55324265, 1.80402969, 1.86348844, 1.9229472 ,
       1.98240596, 2.04186472, 2.10132347, 2.16078223, 2.22024099,
       2.27969975, 2.3391585 , 2.39861726, 2.45807602, 2.51753478,
       2.57699353, 2.63645229, 2.69591105, 2.0110877 , 2.06826251,
       2.12543732, 2.18261213, 2.23978694, 2.29696176, 2.35413657,
       2.41131138, 2.46848619, 2.525661  , 2.58283581, 2.64001062,
       2.69718543, 2.75436024, 2.81153505, 2.86870987, 2.25464078,
       2.30481111, 2.35498144, 2.40515176, 2.45532209, 2.50549242,
       2.55566275, 2.60583307, 2.6560034 , 2.70617373, 2.75634406,
       2.80651438, 2.85668471, 2.90685504, 2.95702536, 3.00719569,
       2.55339368, 2.58992176, 2.62644985, 2.66297794, 2.69950603,
       2.73603411, 2.7725622 , 2.80909029, 2.84561837, 2.88214646,
       2.91867455, 2.95520264, 2.99173072, 3.02825881, 3.0647869 ,
       3.10131498]

lpc_coeff_lsf_bins = lpc_coeff_lsf_bins_256_signal_preprosessed_final_flat
